home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
font_kit.zip
/
MAKEOBJ.BAS
< prev
Wrap
BASIC Source File
|
1993-02-03
|
3KB
|
95 lines
$compile exe
$lib graph-,com-,lpt-,iprint+
$STRING 8
' This program will convert 8x16 bit mapped font files to linkable ASM
' files with a subroutine bearing the same name as the original font file.
' if TASM or MASM exists in the current directory, this program will also
' shell to it and create the OBJ which you can link. Command line or
' prompted file can contain wildcards to create OBJs from an entire
' directory of font files.
if command$="" then input "Enter font filename: ",F$ else F$=Command$
if f$="" then end
f$=dir$(f$)
if f$="" then print "File does not exist.":end
dim f$(500)
x=1
f$(1)=f$
do
incr x
f$(x)=dir$
loop while len(f$(x))
for y=1 to x-1
call makeasm(f$(y))
next y
end
sub makeasm(f$)
open f$ for binary as #1
get$ 1, lof(1), a$
close #1
if instr(f$,".")=0 then f$=f$+"."
p$=left$(f$,instr(f$,".")-1)
F2$=p$ + ".ASM"
open f2$ for output as #1
PRINT #1, p$ + "SEG" + chr$(9,9) + "segment byte public"
PRINT #1, " assume cs:"+p$+"SEG, ds:"+p$+"SEG"
PRINT #1, ""
PRINT #1, p$ + chr$(9,9) + "proc far"
PRINT #1, " public " + p$
PRINT #1, ""
PRINT #1, "start:"
PRINT #1, " push bp"
PRINT #1, " push es"
PRINT #1, " push cs"
PRINT #1, " pop es"
PRINT #1, " mov ax, word ptr font"
PRINT #1, " push ax"
PRINT #1, " pop bp"
PRINT #1, " ADD bp,31"
PRINT #1, " mov ax,1100h"
PRINT #1, " mov bh,16"
PRINT #1, " mov bl,0"
PRINT #1, " mov cx,0FFh"
PRINT #1, " mov dx,0"
PRINT #1, " int 10h"
PRINT #1, " pop es"
PRINT #1, " pop bp"
PRINT #1, " retf"
PRINT #1, ""
PRINT #1, "font";
for y=1 to len(a$) \ 16
b$=mid$(a$,(y*16)-15,16)
c$=" db "
for x=1 to 15
c$=c$+str$(ascii(mid$(b$,x,1))) + ","
next x
c$=c$+str$(ascii(right$(b$,1)))
print #1, c$;
IF y > 32 and y<255 THEN PRINT #1, " ; chr " + str$(y-1) + " - " + CHR$(y-1) else print #1, ""
next y
print #1, ""
print #1, p$ + chr$(9,9) + "endp"
print #1,""
print #1,p$ + "SEG" + chr$(9,9) + "ends"
print #1, ""
print #1," end"
close #1
PRINT "Created " + F2$ + " with proc " + p$
if len(dir$("TASM.EXE")) THEN SHELL "TASM " + F2$
if len(dir$("MASM.EXE")) THEN SHELL "MASM " + F2$
END SUB